package com.example.pingze.controller;


import com.example.pingze.entity.PoemInfo;
import com.example.pingze.service.PoemFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/getPoemInfo")
@CrossOrigin(origins = "*")
public class PoemFileController {
    @Autowired
    private PoemFileService service;
    @GetMapping("/addPoemInfo")
    public void addPoemInfo(){
        List<PoemInfo> list = service.fromJson();
        service.insertPoemInfo(list);
    }
}
